Skip to content

atlas(python): enforce disclosure-context ceilings in atlas_search.py (#12623) - #12633

Merged
dezren39 merged 2 commits into
mainfrom
queue/21058-12623-atlas-disclosure-python
Nov 22, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/21058-12623-atlas-disclosure-python

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #12404: the legacy Python CLI applied only the caller --max-sensitivity ceiling, so output through it bypassed the boundary enforcement #12404 landed for the Rust paths.

Change

  • New --context flag on both search and get-chunk with the design §4 table (fleet-internal → local-only, hosted-per-user → personal, public-surface → shareable, local-owner → secret-bearing; default local-owner, matching the Rust get-chunk default). Unknown contexts fail closed to the public-surface ceiling.
  • The context ∩ caller-ceiling intersection is now the effective ceiling everywhere it matters: search candidate selection (FTS where(), vector branch, Turso allowed-ids/index post-filter — all driven by Filters.allowed_sens), neighbor expansion, full-message payloads (withheld as a whole when any chunk in the message exceeds the boundary), and get-chunk (withheld as not-found).
  • excluded_personal_life is never served in any context; unknown/missing labels fail closed.
  • Defaults are unchanged: search still defaults to a personal caller ceiling, get-chunk to secret-bearing, both under local-owner, so existing local-owner invocations behave as before for classified content.
  • New tests in pkgs/atlas-search/tools/tests/test_disclosure.py mirror crates/atlas-core/tests/disclosure.rs (context table, intersection, fail-closed, neighbor filtering, message withholding).

One deliberate divergence from atlas-core: chunk_classification resolves an unknown label to secret-bearing (servable at local-owner), while this CLI never serves unclassified content — matching its search ceiling filter, which already excluded NULL sensitivity before this slice. The test documents the choice.

Verification

On the laptop worktree (base main f026268, the merged #12404 Rust slice):

  • python3 -m py_compile pkgs/atlas-search/atlas_search.py pkgs/atlas-search/tools/tests/test_disclosure.py — OK
  • python3 -I -m unittest discover -s pkgs/atlas-search/tools/tests -v — 11 tests, OK (6 new disclosure tests + 5 pre-existing sweep tests)
  • atlas_search.py search --help / get-chunk --help — --context / --max-sensitivity present with the documented defaults

No Rust changes; no whole-suite run (narrowest verification per the slice).

Refs #12623


<a href="https://dashboardbackend.blacksmith.sh/track/run-proof?expires=1797958657&installation_model_id=443529&pr_number=12633&ref=codesmith_pr_footer&repository=developing-today%2Fcode&return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fpull%2F12633&variant=run_proof_on_this_pr&signature=1e96c0d09200ab615e60d5c938e1f154a548a3516c34d8e8446a327d49e2fbef"&gt;&lt;picture&gt;&lt;source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/proof-run-proof-on-this-pr-v2-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/proof-run-proof-on-this-pr-v2-light.svg"&gt;&lt;img alt="Run Proof on this PR" src="https://pr-comments-assets.blacksmith.sh/codesmith/proof-run-proof-on-this-pr-v2-dark-3x.png" width="168" height="28"&gt;
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Generated by Claude Code

…#12623)

The legacy Python CLI applied only the caller --max-sensitivity ceiling,
so output through it bypassed the #12404 boundary enforcement: add a
--context flag (design section 4 table, default local-owner) and apply
the context/caller-ceiling intersection at render for search results,
neighbor expansion, full-message payloads, and get-chunk. The
excluded_personal_life disposition is never served and unknown/missing
labels fail closed. Tests mirror crates/atlas-core/tests/disclosure.rs.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 16:57
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6e9ea812-45ca-46b2-9eb6-b2ab5181c295
Commits

Reviewing files that changed from the base of the PR and between f511bc5 and 1ce40db.

Files selected for processing: 2

  • pkgs/atlas-search/atlas_search.py
  • pkgs/atlas-search/tools/tests/test_disclosure.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T17:24:37.002256Z 1ce40db Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72db26db5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkgs/atlas-search/atlas_search.py Resolved
@dezren39

Copy link
Copy Markdown
Member Author

@codex review

Addressed both findings in 1ce40db: chunk/neighbor output authorization now uses the raw chunk classification (missing classifications cannot inherit session labels), and disclosure context × caller × classification is checked exhaustively against an independent rank-based oracle. Laptop verification: py_compile passed; unittest discover 13/13 passed; git diff --check passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 1ce40dbde6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39
dezren39 merged commit 8d696e4 into main Nov 22, 2026
2 checks passed
@dezren39
dezren39 deleted the queue/21058-12623-atlas-disclosure-python branch November 22, 2026 18:01
@dezren39 dezren39 added the audit:partial PR partially implemented; gap filed label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit:partial PR partially implemented; gap filed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant